package com.example.product.feign;

import com.example.product.dto.ProductDTO;
import com.example.rest.RestBody;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient("product-service")
public interface ProductFeign {

    @GetMapping("/product/{code}")
    RestBody<?> getByCode(@PathVariable(value = "code")String code);

    @PostMapping("/product/reduce/store")
    RestBody<?> reduceProductStore(@RequestBody ProductDTO productDTO);

}
